﻿CREATE PROCEDURE [dbo].[kp_GetNextSttRec]		
AS
	Declare @CurrentSTTRec nvarchar(10),@Pattern nvarchar(10)
	set @Pattern='0000000000'
	Update [tblDmStt] set Stt_Rec_Ht=ISNULL(Stt_Rec_Ht,0)+1
	select @CurrentSTTRec=cast(Stt_Rec_Ht as nvarchar(10)) from [tblDmStt]
	set @CurrentSTTRec=LEFT(@Pattern,len(@Pattern)-len(@CurrentSTTRec))+@CurrentSTTRec
	select @CurrentSTTRec as Stt_Rec
	
RETURN 0;